
#ifndef _SKYROAD_MESSAGE_PATH_H
#define _SKYROAD_MESSAGE_PATH_H

#include <string>
#include <vector>

#include <boost/tokenizer.hpp>
#include <boost/foreach.hpp>
#include <boost/functional/hash.hpp>
#include <skyroad/detail/config.hpp>

class SKYROAD_DECL message_path
{
    typedef int segment_t;
    typedef std::vector<segment_t> segment_list;
    typedef segment_list::iterator iterator;
    typedef segment_list::const_iterator const_iterator;

public:
    message_path() 
    {
    }

    const_iterator begin() const
    {
        return m_segments.begin();
    }

    const_iterator end() const 
    {
        return m_segments.end();
    }

    std::size_t size() const
    {
        return m_segments.size();
    }

    segment_t const& operator[](std::size_t index) 
    {
        return m_segments[index];
    }

    void swap(message_path& rhs)
    {
        m_segments.swap(rhs.m_segments);
    }

private:

    segment_list m_segments;
    friend message_path& operator <<(message_path& path, const message_path::segment_t& tail);

};

inline message_path& operator << (message_path& path, const message_path::segment_t& tail)
{
    path.m_segments.push_back(tail);
    return path;
}

#endif